package com.zb.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;

/**
 * @Author WEN
 * @Date 2023/9/8 0008
 **/
@Data
@ApiModel("组件模板对象")
public class CodePrintTemplateComponentVo {

    @ApiModelProperty(value = "组件模板ID，新增不必传，修改必传")
    private Long id;

    @ApiModelProperty(value = "组件类型：1-编码组件，2-图片组件，3-文本组件", hidden = true, example = "0")
    private Integer type;

    @NotBlank(message = "组件模板名称不能为空")
    @Length(max = 20, message = "组件模板名称限制 20 个字符以内")
    @ApiModelProperty(value = "组件模板名称", required = true)
    private String name;

    @Valid
    @NotNull(message = "组件对象不能为空")
    @Size(min = 1, message = "至少填写一项组件")
    @ApiModelProperty(value = "组件对象")
    List<CodePrintTemplateComponentChildVo> components;
}
